home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Toolbox / Visual Basic Toolbox (P.I.E.)(1996).ISO / arrays / vsflex / grdemo.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1995-06-19  |  27.8 KB  |  817 lines

  1. VERSION 2.00
  2. Begin Form fGrid 
  3.    BackColor       =   &H00C0C0C0&
  4.    BorderStyle     =   3  'Fixed Double
  5.    Caption         =   "VideoSoft Visual Array"
  6.    ClientHeight    =   5700
  7.    ClientLeft      =   1380
  8.    ClientTop       =   1395
  9.    ClientWidth     =   8550
  10.    FontBold        =   0   'False
  11.    FontItalic      =   0   'False
  12.    FontName        =   "MS Sans Serif"
  13.    FontSize        =   8.25
  14.    FontStrikethru  =   0   'False
  15.    FontUnderline   =   0   'False
  16.    Height          =   6165
  17.    Left            =   1290
  18.    LinkTopic       =   "Form1"
  19.    MaxButton       =   0   'False
  20.    ScaleHeight     =   5700
  21.    ScaleWidth      =   8550
  22.    Top             =   1020
  23.    Width           =   8730
  24.    Begin CommandButton Command1 
  25.       BackColor       =   &H00C0C0C0&
  26.       Caption         =   "FillStyle"
  27.       FontBold        =   0   'False
  28.       FontItalic      =   0   'False
  29.       FontName        =   "MS Sans Serif"
  30.       FontSize        =   8.25
  31.       FontStrikethru  =   0   'False
  32.       FontUnderline   =   0   'False
  33.       Height          =   330
  34.       Index           =   0
  35.       Left            =   180
  36.       TabIndex        =   9
  37.       Top             =   5265
  38.       Width           =   1155
  39.    End
  40.    Begin Frame Frame2 
  41.       BackColor       =   &H00C0C0C0&
  42.       Caption         =   "Array"
  43.       FontBold        =   0   'False
  44.       FontItalic      =   0   'False
  45.       FontName        =   "MS Sans Serif"
  46.       FontSize        =   8.25
  47.       FontStrikethru  =   0   'False
  48.       FontUnderline   =   0   'False
  49.       ForeColor       =   &H00FF0000&
  50.       Height          =   1620
  51.       Left            =   195
  52.       TabIndex        =   22
  53.       Top             =   180
  54.       Width           =   4485
  55.       Begin CheckBox eGridLines 
  56.          BackColor       =   &H00C0C0C0&
  57.          Caption         =   "Grid Lines"
  58.          FontBold        =   0   'False
  59.          FontItalic      =   0   'False
  60.          FontName        =   "MS Sans Serif"
  61.          FontSize        =   8.25
  62.          FontStrikethru  =   0   'False
  63.          FontUnderline   =   0   'False
  64.          ForeColor       =   &H00000000&
  65.          Height          =   270
  66.          Left            =   3015
  67.          TabIndex        =   3
  68.          Top             =   495
  69.          Value           =   1  'Checked
  70.          Width           =   1095
  71.       End
  72.       Begin ComboBox cmbEditControl 
  73.          FontBold        =   0   'False
  74.          FontItalic      =   0   'False
  75.          FontName        =   "MS Sans Serif"
  76.          FontSize        =   8.25
  77.          FontStrikethru  =   0   'False
  78.          FontUnderline   =   0   'False
  79.          Height          =   315
  80.          Left            =   1530
  81.          Style           =   2  'Dropdown List
  82.          TabIndex        =   2
  83.          Top             =   495
  84.          Width           =   1365
  85.       End
  86.       Begin CheckBox eBlob 
  87.          BackColor       =   &H00C0C0C0&
  88.          Caption         =   "Special effect"
  89.          FontBold        =   0   'False
  90.          FontItalic      =   0   'False
  91.          FontName        =   "MS Sans Serif"
  92.          FontSize        =   8.25
  93.          FontStrikethru  =   0   'False
  94.          FontUnderline   =   0   'False
  95.          ForeColor       =   &H00000000&
  96.          Height          =   240
  97.          Left            =   3015
  98.          TabIndex        =   1
  99.          Top             =   225
  100.          Width           =   1305
  101.       End
  102.       Begin HScrollBar zoom 
  103.          Height          =   240
  104.          Left            =   90
  105.          Max             =   36
  106.          Min             =   3
  107.          TabIndex        =   0
  108.          TabStop         =   0   'False
  109.          Top             =   525
  110.          Value           =   6
  111.          Width           =   1350
  112.       End
  113.       Begin Label ltool 
  114.          AutoSize        =   -1  'True
  115.          BackColor       =   &H00C0C0C0&
  116.          BackStyle       =   0  'Transparent
  117.          FontBold        =   0   'False
  118.          FontItalic      =   0   'False
  119.          FontName        =   "MS Sans Serif"
  120.          FontSize        =   8.25
  121.          FontStrikethru  =   0   'False
  122.          FontUnderline   =   0   'False
  123.          ForeColor       =   &H00FF0000&
  124.          Height          =   195
  125.          Index           =   1
  126.          Left            =   1095
  127.          TabIndex        =   26
  128.          Top             =   1305
  129.          Width           =   45
  130.       End
  131.       Begin Label Label1 
  132.          AutoSize        =   -1  'True
  133.          BackColor       =   &H00C0C0C0&
  134.          BackStyle       =   0  'Transparent
  135.          Caption         =   "Selection:"
  136.          FontBold        =   0   'False
  137.          FontItalic      =   0   'False
  138.          FontName        =   "MS Sans Serif"
  139.          FontSize        =   8.25
  140.          FontStrikethru  =   0   'False
  141.          FontUnderline   =   0   'False
  142.          ForeColor       =   &H00000000&
  143.          Height          =   195
  144.          Index           =   7
  145.          Left            =   135
  146.          TabIndex        =   25
  147.          Top             =   1305
  148.          Width           =   705
  149.       End
  150.       Begin Label ltool 
  151.          AutoSize        =   -1  'True
  152.          BackColor       =   &H00C0C0C0&
  153.          BackStyle       =   0  'Transparent
  154.          FontBold        =   0   'False
  155.          FontItalic      =   0   'False
  156.          FontName        =   "MS Sans Serif"
  157.          FontSize        =   8.25
  158.          FontStrikethru  =   0   'False
  159.          FontUnderline   =   0   'False
  160.          ForeColor       =   &H00FF0000&
  161.          Height          =   195
  162.          Index           =   0
  163.          Left            =   1080
  164.          TabIndex        =   10
  165.          Top             =   1095
  166.          Width           =   45
  167.       End
  168.       Begin Label Label1 
  169.          AutoSize        =   -1  'True
  170.          BackColor       =   &H00C0C0C0&
  171.          BackStyle       =   0  'Transparent
  172.          Caption         =   "Mouse Over:"
  173.          FontBold        =   0   'False
  174.          FontItalic      =   0   'False
  175.          FontName        =   "MS Sans Serif"
  176.          FontSize        =   8.25
  177.          FontStrikethru  =   0   'False
  178.          FontUnderline   =   0   'False
  179.          ForeColor       =   &H00000000&
  180.          Height          =   195
  181.          Index           =   5
  182.          Left            =   135
  183.          TabIndex        =   15
  184.          Top             =   1080
  185.          Width           =   915
  186.       End
  187.       Begin Label Label1 
  188.          AutoSize        =   -1  'True
  189.          BackColor       =   &H00C0C0C0&
  190.          BackStyle       =   0  'Transparent
  191.          Caption         =   "Edit as"
  192.          FontBold        =   0   'False
  193.          FontItalic      =   0   'False
  194.          FontName        =   "MS Sans Serif"
  195.          FontSize        =   8.25
  196.          FontStrikethru  =   0   'False
  197.          FontUnderline   =   0   'False
  198.          ForeColor       =   &H00000000&
  199.          Height          =   195
  200.          Index           =   6
  201.          Left            =   1530
  202.          TabIndex        =   24
  203.          Top             =   270
  204.          Width           =   480
  205.       End
  206.       Begin Label Label1 
  207.          BackColor       =   &H00C0C0C0&
  208.          BackStyle       =   0  'Transparent
  209.          Caption         =   "Zoom"
  210.          FontBold        =   0   'False
  211.          FontItalic      =   0   'False
  212.          FontName        =   "MS Sans Serif"
  213.          FontSize        =   8.25
  214.          FontStrikethru  =   0   'False
  215.          FontUnderline   =   0   'False
  216.          ForeColor       =   &H00000000&
  217.          Height          =   195
  218.          Index           =   1
  219.          Left            =   105
  220.          TabIndex        =   23
  221.          Top             =   300
  222.          Width           =   405
  223.       End
  224.    End
  225.    Begin Frame Frame1 
  226.       BackColor       =   &H00C0C0C0&
  227.       Caption         =   "Range or Cell Format"
  228.       FontBold        =   0   'False
  229.       FontItalic      =   0   'False
  230.       FontName        =   "MS Sans Serif"
  231.       FontSize        =   8.25
  232.       FontStrikethru  =   0   'False
  233.       FontUnderline   =   0   'False
  234.       ForeColor       =   &H00FF0000&
  235.       Height          =   1650
  236.       Left            =   4965
  237.       TabIndex        =   19
  238.       Top             =   150
  239.       Width           =   3405
  240.       Begin CommandButton eFontBigger 
  241.          BackColor       =   &H00C0C0C0&
  242.          Caption         =   "+"
  243.          FontBold        =   0   'False
  244.          FontItalic      =   0   'False
  245.          FontName        =   "MS Sans Serif"
  246.          FontSize        =   8.25
  247.          FontStrikethru  =   0   'False
  248.          FontUnderline   =   0   'False
  249.          Height          =   210
  250.          Left            =   1845
  251.          TabIndex        =   7
  252.          Top             =   1215
  253.          Width           =   330
  254.       End
  255.       Begin CommandButton eFontSmaller 
  256.          BackColor       =   &H00C0C0C0&
  257.          Caption         =   "-"
  258.          FontBold        =   -1  'True
  259.          FontItalic      =   0   'False
  260.          FontName        =   "Arial"
  261.          FontSize        =   8.25
  262.          FontStrikethru  =   0   'False
  263.          FontUnderline   =   0   'False
  264.          Height          =   210
  265.          Left            =   2250
  266.          TabIndex        =   8
  267.          Top             =   1215
  268.          Width           =   330
  269.       End
  270.       Begin ComboBox cmbCellAlign 
  271.          FontBold        =   0   'False
  272.          FontItalic      =   0   'False
  273.          FontName        =   "MS Sans Serif"
  274.          FontSize        =   8.25
  275.          FontStrikethru  =   0   'False
  276.          FontUnderline   =   0   'False
  277.          Height          =   300
  278.          Left            =   1845
  279.          Style           =   2  'Dropdown List
  280.          TabIndex        =   5
  281.          Top             =   585
  282.          Width           =   1350
  283.       End
  284.       Begin ComboBox FontList 
  285.          FontBold        =   0   'False
  286.          FontItalic      =   0   'False
  287.          FontName        =   "MS Sans Serif"
  288.          FontSize        =   8.25
  289.          FontStrikethru  =   0   'False
  290.          FontUnderline   =   0   'False
  291.          Height          =   300
  292.          Left            =   1845
  293.          Style           =   2  'Dropdown List
  294.          TabIndex        =   6
  295.          TabStop         =   0   'False
  296.          Top             =   855
  297.          Width           =   1350
  298.       End
  299.       Begin ComboBox ColorList 
  300.          FontBold        =   0   'False
  301.          FontItalic      =   0   'False
  302.          FontName        =   "MS Sans Serif"
  303.          FontSize        =   8.25
  304.          FontStrikethru  =   0   'False
  305.          FontUnderline   =   0   'False
  306.          Height          =   300
  307.          Left            =   1845
  308.          Style           =   2  'Dropdown List
  309.          TabIndex        =   4
  310.          TabStop         =   0   'False
  311.          Top             =   315
  312.          Width           =   1350
  313.       End
  314.       Begin CheckBox eItalic 
  315.          BackColor       =   &H00C0C0C0&
  316.          Caption         =   "&Italic"
  317.          FontBold        =   0   'False
  318.          FontItalic      =   -1  'True
  319.          FontName        =   "MS Sans Serif"
  320.          FontSize        =   8.25
  321.          FontStrikethru  =   0   'False
  322.          FontUnderline   =   0   'False
  323.          ForeColor       =   &H00000000&
  324.          Height          =   300
  325.          Left            =   195
  326.          TabIndex        =   21
  327.          Top             =   585
  328.          Width           =   735
  329.       End
  330.       Begin CheckBox eBold 
  331.          BackColor       =   &H00C0C0C0&
  332.          Caption         =   "Bold"
  333.          ForeColor       =   &H00000000&
  334.          Height          =   300
  335.          Left            =   195
  336.          TabIndex        =   20
  337.          Top             =   315
  338.          Width           =   750
  339.       End
  340.       Begin Label Label1 
  341.          AutoSize        =   -1  'True
  342.          BackColor       =   &H00C0C0C0&
  343.          BackStyle       =   0  'Transparent
  344.          Caption         =   "FontSize"
  345.          FontBold        =   0   'False
  346.          FontItalic      =   0   'False
  347.          FontName        =   "MS Sans Serif"
  348.          FontSize        =   8.25
  349.          FontStrikethru  =   0   'False
  350.          FontUnderline   =   0   'False
  351.          ForeColor       =   &H00000000&
  352.          Height          =   195
  353.          Index           =   2
  354.          Left            =   1095
  355.          TabIndex        =   18
  356.          Top             =   1215
  357.          Width           =   615
  358.       End
  359.       Begin Label Label1 
  360.          BackColor       =   &H00C0C0C0&
  361.          BackStyle       =   0  'Transparent
  362.          Caption         =   "Align"
  363.          FontBold        =   0   'False
  364.          FontItalic      =   0   'False
  365.          FontName        =   "MS Sans Serif"
  366.          FontSize        =   8.25
  367.          FontStrikethru  =   0   'False
  368.          FontUnderline   =   0   'False
  369.          ForeColor       =   &H00000000&
  370.          Height          =   195
  371.          Index           =   0
  372.          Left            =   1455
  373.          TabIndex        =   14
  374.          Top             =   630
  375.          Width           =   345
  376.       End
  377.       Begin Label Label1 
  378.          AutoSize        =   -1  'True
  379.          BackColor       =   &H00C0C0C0&
  380.          BackStyle       =   0  'Transparent
  381.          Caption         =   "Color"
  382.          FontBold        =   0   'False
  383.          FontItalic      =   0   'False
  384.          FontName        =   "MS Sans Serif"
  385.          FontSize        =   8.25
  386.          FontStrikethru  =   0   'False
  387.          FontUnderline   =   0   'False
  388.          ForeColor       =   &H00000000&
  389.          Height          =   195
  390.          Index           =   4
  391.          Left            =   1410
  392.          TabIndex        =   17
  393.          Top             =   360
  394.          Width           =   360
  395.       End
  396.       Begin Label Label1 
  397.          AutoSize        =   -1  'True
  398.          BackColor       =   &H00C0C0C0&
  399.          BackStyle       =   0  'Transparent
  400.          Caption         =   "FontName"
  401.          FontBold        =   0   'False
  402.          FontItalic      =   0   'False
  403.          FontName        =   "MS Sans Serif"
  404.          FontSize        =   8.25
  405.          FontStrikethru  =   0   'False
  406.          FontUnderline   =   0   'False
  407.          ForeColor       =   &H00000000&
  408.          Height          =   195
  409.          Index           =   3
  410.          Left            =   1080
  411.          TabIndex        =   16
  412.          Top             =   900
  413.          Width           =   735
  414.       End
  415.    End
  416.    Begin vsFlexArray vsFlexArray 
  417.       BackColor       =   &H00FFFFFF&
  418.       BackColorFixed  =   &H00C0C0C0&
  419.       Cols            =   22
  420.       FillStyle       =   1  'Repeat
  421.       FontBold        =   0   'False
  422.       FontItalic      =   0   'False
  423.       FontName        =   "MS Sans Serif"
  424.       FontSize        =   9.75
  425.       FontStrikethru  =   0   'False
  426.       FontUnderline   =   0   'False
  427.       ForeColor       =   &H00000000&
  428.       ForeColorFixed  =   &H00808080&
  429.       GridColorFixed  =   &H00808080&
  430.       Height          =   3300
  431.       Left            =   195
  432.       Rows            =   100
  433.       TabIndex        =   11
  434.       TabStop         =   0   'False
  435.       TextStyleFixed  =   1  'Raised
  436.       Top             =   1905
  437.       Width           =   8160
  438.       Begin TextBox Text 
  439.          BorderStyle     =   0  'None
  440.          FontBold        =   0   'False
  441.          FontItalic      =   0   'False
  442.          FontName        =   "MS Sans Serif"
  443.          FontSize        =   8.25
  444.          FontStrikethru  =   0   'False
  445.          FontUnderline   =   0   'False
  446.          Height          =   240
  447.          Left            =   195
  448.          TabIndex        =   13
  449.          TabStop         =   0   'False
  450.          Top             =   1095
  451.          Visible         =   0   'False
  452.          Width           =   810
  453.       End
  454.       Begin ComboBox List 
  455.          FontBold        =   0   'False
  456.          FontItalic      =   0   'False
  457.          FontName        =   "MS Sans Serif"
  458.          FontSize        =   8.25
  459.          FontStrikethru  =   0   'False
  460.          FontUnderline   =   0   'False
  461.          Height          =   300
  462.          Left            =   195
  463.          Style           =   2  'Dropdown List
  464.          TabIndex        =   12
  465.          TabStop         =   0   'False
  466.          Top             =   1605
  467.          Visible         =   0   'False
  468.          Width           =   750
  469.       End
  470.       Begin Shape Blob 
  471.          BackColor       =   &H000000FF&
  472.          BorderColor     =   &H00000080&
  473.          BorderStyle     =   2  'Dash
  474.          BorderWidth     =   4
  475.          FillColor       =   &H000000FF&
  476.          Height          =   315
  477.          Left            =   210
  478.          Shape           =   2  'Oval
  479.          Top             =   480
  480.          Visible         =   0   'False
  481.          Width           =   555
  482.       End
  483.       Begin Image img 
  484.          Height          =   480
  485.          Left            =   210
  486.          Picture         =   GRDEMO.FRX:0000
  487.          Top             =   75
  488.          Visible         =   0   'False
  489.          Width           =   480
  490.       End
  491.    End
  492. Option Explicit
  493. Sub cmbCellAlign_Click ()
  494.     Select Case cmbCellAlign.ListIndex
  495.         Case 0: vsFlexArray.CellAlignment = 1
  496.         Case 1: vsFlexArray.CellAlignment = 4
  497.         Case 2: vsFlexArray.CellAlignment = 7
  498.     End Select
  499. End Sub
  500. Sub ColorList_Click ()
  501.     If Not vsFlexArray.Visible Then Exit Sub
  502.     Select Case ColorList.ListIndex
  503.         Case 0 ' (default)
  504.             vsFlexArray.CellBackColor = 0
  505.             vsFlexArray.CellForeColor = 0
  506.         Case 1 ' USA/France
  507.             vsFlexArray.CellBackColor = &HC00000
  508.             vsFlexArray.CellForeColor = &HC0&
  509.         Case 2 ' Germany
  510.             vsFlexArray.CellBackColor = &HFFFF&
  511.             vsFlexArray.CellForeColor = 1
  512.         Case 3 ' Mexico/Italy
  513.             vsFlexArray.CellBackColor = &H8000&
  514.             vsFlexArray.CellForeColor = &HFF&
  515.         Case 4 ' Canada/Japan
  516.             vsFlexArray.CellBackColor = &HFF&
  517.             vsFlexArray.CellForeColor = &HFFFFFF
  518.         Case 5 ' Ireland
  519.             vsFlexArray.CellBackColor = &H8000&
  520.             vsFlexArray.CellForeColor = &HFFFFFF
  521.         Case 6 ' Sweden
  522.             vsFlexArray.CellBackColor = &HFF0000
  523.             vsFlexArray.CellForeColor = &HFFFF&
  524.         Case 7 ' Argentina
  525.             vsFlexArray.CellBackColor = &H808000
  526.             vsFlexArray.CellForeColor = &HFFFFFF
  527.         Case 8 ' Brazil
  528.             vsFlexArray.CellBackColor = &HFFFF&
  529.             vsFlexArray.CellForeColor = &H8000&
  530.         Case 9 ' Japan
  531.             vsFlexArray.CellBackColor = &HFFFFFF
  532.             vsFlexArray.CellForeColor = &HFF&
  533.     End Select
  534.     markrow
  535.     If vsFlexArray.Visible Then vsFlexArray.SetFocus
  536. End Sub
  537. Sub Command1_Click (Index%)
  538.     Dim cr$
  539.     cr = Chr$(13)
  540.     Select Case Index
  541.         Case 0: MsgBox "The repeat Fillstyle lets you create multiple cells at once." & cr & cr & "Select a cell range, type a string, and press Enter"
  542.     End Select
  543. End Sub
  544. Sub DoInitializeCombos ()
  545.     '-------------------------------------------------
  546.     ' initialize zoom scroller
  547.     zoom = vsFlexArray.FontSize
  548.     '-------------------------------------------------
  549.     ' initialize font list
  550.     FontList.AddItem "(default)"
  551.     FontList.AddItem "Arial"
  552.     FontList.AddItem "Courier New"
  553.     FontList.AddItem "Times New Roman"
  554.     FontList.AddItem "Symbol"
  555.     FontList.AddItem "System"
  556.     FontList.AddItem "Wingdings"
  557.     FontList.ListIndex = 0
  558.     '-------------------------------------------------
  559.     ' initialize color list
  560.     ColorList.AddItem "(default)"
  561.     ColorList.AddItem "USA/France"
  562.     ColorList.AddItem "Germany"
  563.     ColorList.AddItem "Mexico/Italy"
  564.     ColorList.AddItem "Canada"
  565.     ColorList.AddItem "Ireland"
  566.     ColorList.AddItem "Sweden"
  567.     ColorList.AddItem "Argentina"
  568.     ColorList.AddItem "Brazil"
  569.     ColorList.AddItem "Japan"
  570.     ColorList.ListIndex = 0
  571.     '-------------------------------------------------
  572.     ' initialize pick list
  573.     list.AddItem "Spaghetti"
  574.     list.AddItem "Fetuccine"
  575.     list.AddItem "Vermicelli"
  576.     list.AddItem "Capellini"
  577.     list.AddItem "Linguine"
  578.     list.AddItem "Rotelli"
  579.     list.AddItem "Penne"
  580.     list.AddItem "Veadelli"
  581.     '-------------------------------------------------
  582.     ' initialize CellAlign
  583.     cmbCellAlign.AddItem "Left"
  584.     cmbCellAlign.AddItem "Center"
  585.     cmbCellAlign.AddItem "Right"
  586.     cmbCellAlign.ListIndex = 0
  587.     '-------------------------------------------------
  588.     ' initialize Edit control
  589.     cmbEditControl.AddItem "Text box"
  590.     cmbEditControl.AddItem "Dropdown list"
  591.     cmbEditControl.AddItem "Don't Edit"
  592.     cmbEditControl.ListIndex = 0
  593. End Sub
  594. Sub ebold_Click ()
  595.     vsFlexArray.CellFontBold = Not vsFlexArray.CellFontBold
  596. End Sub
  597. Sub EditKeyCode (g As Control, c As Control, KeyCode%, Shift%)
  598.   ' standard edit control processing
  599.   Select Case KeyCode
  600.     Case 27 ' esc
  601.       c.Visible = False
  602.       g.SetFocus
  603.     Case 13 ' enter
  604.       g.SetFocus
  605.     Case 40 ' down
  606.       g.SetFocus
  607.       DoEvents
  608.       If g.Row < g.Rows - 1 Then
  609.         g.Row = g.Row + 1
  610.       End If
  611.     Case 38 ' up
  612.       g.SetFocus
  613.       DoEvents
  614.       If g.Row > g.FixedRows Then
  615.         g.Row = g.Row - 1
  616.       End If
  617.   End Select
  618. End Sub
  619. Sub eFontBigger_Click ()
  620.     Dim i%
  621.     i = vsFlexArray.CellFontSize
  622.     If i = 0 Then i = vsFlexArray.FontSize
  623.     i = i + 2
  624.     If i <= 36 Then
  625.         vsFlexArray.CellFontSize = i
  626.     End If
  627. End Sub
  628. Sub eFontSmaller_Click ()
  629.     Dim i%
  630.     i = vsFlexArray.CellFontSize
  631.     If i = 0 Then i = vsFlexArray.FontSize
  632.     i = i - 2
  633.     If i >= 3 Then
  634.         vsFlexArray.CellFontSize = i
  635.     End If
  636. End Sub
  637. Sub eGridLines_Click ()
  638.      vsFlexArray.GridLines = eGridLines
  639. End Sub
  640. Sub eItalic_Click ()
  641.     vsFlexArray.CellFontItalic = Not vsFlexArray.CellFontItalic
  642. End Sub
  643. Sub FontList_Click ()
  644.     If Not vsFlexArray.Visible Then Exit Sub
  645.     If FontList.ListIndex = 0 Then
  646.         vsFlexArray.CellFontName = ""
  647.     Else
  648.         vsFlexArray.CellFontName = FontList
  649.     End If
  650.     markrow
  651.     If vsFlexArray.Visible Then vsFlexArray.SetFocus
  652. End Sub
  653. Sub Form_DblClick ()
  654.     Dim s$
  655.     Debug.Print vsFlexArray.Clip
  656.     s = "1,1" + Chr(9) + "1,2" + Chr(9) + "1,3" + Chr(13)
  657.     s = s + "2,1" + Chr(9) + "2,2" + Chr(9) + "2,3" + Chr(13)
  658.     s = s + "3,1" + Chr(9) + "3,2" + Chr(9) + "3,3"
  659.     vsFlexArray.Clip = s
  660. End Sub
  661. Sub Form_Load ()
  662.     DoGridTitles vsFlexArray        ' Place cell numbers on the fix columns
  663.     DoInitializeCombos              ' Add options
  664.     DoGetData                       ' Retrieve data
  665.     DoFillArray vsFlexArray, 2, 2   ' Place data on vsFlexArray
  666. End Sub
  667. Sub GridEdit (g As Control, c As Control, keyascii As Integer)
  668.     '--------------------------------------------------
  669.     ' prepare the control
  670.     c.FontName = g.FontName
  671.     If TypeOf c Is TextBox Then
  672.         c.FontSize = g.FontSize
  673.         Select Case keyascii
  674.             Case 0 To 32
  675.                 c = g
  676.                 c.SelStart = 1000
  677.             Case Else
  678.                 c = Chr(keyascii)
  679.                 c.SelStart = 1
  680.         End Select
  681.     Else
  682.         c.FontSize = g.FontSize * .75
  683.     End If
  684.     c.FontName = g.FontName
  685.     '--------------------------------------------------
  686.     ' show it at the right place
  687.     If g.FillStyle = 0 Then
  688.         If g.Row <> g.RowSel Or g.Col <> g.ColSel Then
  689.             g.RowSel = g.Row
  690.             g.ColSel = g.Col
  691.         End If
  692.     End If
  693.     ' and let it rip
  694.     On Error Resume Next
  695.     c.Move g.CellLeft, g.CellTop
  696.     c.Width = g.CellWidth
  697.     c.Height = g.CellHeight
  698.     c.Visible = True
  699.     c.SetFocus
  700.     On Error GoTo 0
  701. End Sub
  702. Sub list_KeyDown (KeyCode As Integer, Shift As Integer)
  703.     ' standard edit control processing
  704.     EditKeyCode vsFlexArray, list, KeyCode, Shift
  705. End Sub
  706. Sub markrow ()
  707.     Dim i%, r%, c%, rs%, cs%, st%
  708.     r = vsFlexArray.Row
  709.     rs = vsFlexArray.RowSel
  710.     c = vsFlexArray.Col
  711.     cs = vsFlexArray.ColSel
  712.     If r <= rs Then st = 1 Else st = -1
  713.     vsFlexArray.Col = 0
  714.     For i = r To rs Step st
  715.         vsFlexArray.Row = i
  716.         vsFlexArray.CellPicture = img
  717.     Next
  718.     vsFlexArray.Row = r
  719.     vsFlexArray.Col = c
  720.     vsFlexArray.RowSel = rs
  721.     vsFlexArray.ColSel = cs
  722. End Sub
  723. Sub Text_KeyDown (KeyCode As Integer, Shift As Integer)
  724.     ' standard edit control processing
  725.     EditKeyCode vsFlexArray, text, KeyCode, Shift
  726. End Sub
  727. Sub Text_KeyPress (keyascii As Integer)
  728.     If keyascii = 13 Then keyascii = 0
  729. End Sub
  730. Sub vsFlexArray_DblClick ()
  731.     Select Case cmbEditControl.ListIndex
  732.         Case 0: GridEdit vsFlexArray, text, 32
  733.         Case 1: GridEdit vsFlexArray, list, 32
  734.     End Select
  735. End Sub
  736. Sub vsFlexArray_EnterCell ()
  737.     Dim i%
  738.     ' show a blob blinking as we move (very annoying)
  739.     If eBlob = 0 Then Exit Sub
  740.     For i = -vsFlexArray.CellHeight / 2 To vsFlexArray.CellHeight / 2 Step 30
  741.         blob.Visible = False
  742.         blob.Move vsFlexArray.CellLeft - i, vsFlexArray.CellTop - i
  743.         blob.Width = vsFlexArray.CellWidth + 2 * i
  744.         blob.Height = vsFlexArray.CellHeight + 2 * i + 1
  745.         blob.Visible = True
  746.         blob.Refresh
  747.     Next
  748.     blob.Visible = False
  749. End Sub
  750. Sub vsFlexArray_GotFocus ()
  751.     '--------------------------------------------------
  752.     ' if our edit box is  up, copy its contents
  753.     If text.Visible Then
  754.         vsFlexArray = text
  755.         text.Visible = False
  756.     '--------------------------------------------------
  757.     ' if our list is  up, copy its contents
  758.     ElseIf list.Visible Then
  759.         vsFlexArray = list
  760.         list.Visible = False
  761.     End If
  762. End Sub
  763. Sub vsFlexArray_KeyPress (keyascii As Integer)
  764.     ' start editing
  765.     Select Case cmbEditControl.ListIndex
  766.         Case 0: GridEdit vsFlexArray, text, keyascii
  767.         Case 1: GridEdit vsFlexArray, list, keyascii
  768.     End Select
  769. End Sub
  770. Sub vsFlexArray_LeaveCell ()
  771.   '--------------------------------------------------
  772.   ' if our edit box is up, copy its contents
  773.   If text.Visible Then
  774.     vsFlexArray = text
  775.     text.Visible = False
  776.   End If
  777.   '--------------------------------------------------
  778.   ' if our list is up, copy its contents
  779.   If list.Visible Then
  780.     vsFlexArray = list
  781.     list.Visible = False
  782.   End If
  783. End Sub
  784. Sub vsFlexArray_MouseDown (button As Integer, Shift As Integer, X As Single, Y As Single)
  785.     ' change mouse pointer to show we're selecting
  786.     If button = 1 Then vsFlexArray.MousePointer = 10
  787. End Sub
  788. Sub vsFlexArray_MouseMove (button As Integer, Shift As Integer, X As Single, Y As Single)
  789.     Static r%, c%
  790.     ' user feedback as we move the mouse
  791.     If r = vsFlexArray.MouseRow And c = vsFlexArray.MouseCol Then Exit Sub
  792.     r = vsFlexArray.MouseRow
  793.     c = vsFlexArray.MouseCol
  794.     If r = 0 And c > 0 Then lTool(0) = "Column Header " & Format(c)
  795.     If c = 0 And r > 0 Then lTool(0) = "Row Header    " & Format(r)
  796.     If c = 0 And r = 0 Then lTool(0) = "Origin"
  797.     If r > 0 And c > 0 Then lTool(0) = "Row: " & Format(r) & " Column: " & Format(c)
  798. End Sub
  799. Sub vsFlexArray_MouseUp (button As Integer, Shift As Integer, X As Single, Y As Single)
  800.     ' restore mouse pointer
  801.     vsFlexArray.MousePointer = 0
  802. End Sub
  803. Sub vsFlexArray_SelChange ()
  804.     Dim s$
  805.     ' user feedback
  806.     s = "FROM row: " + Format(vsFlexArray.Row) + " col: " + Format(vsFlexArray.Col)
  807.     s = s + " TO row: " + Format(vsFlexArray.RowSel) + " col: " + Format(vsFlexArray.ColSel)
  808.     lTool(1) = s
  809. End Sub
  810. Sub zoom_Change ()
  811.   ' zoom in and out by changing font size
  812.   If vsFlexArray.Visible Then vsFlexArray.SetFocus
  813.   vsFlexArray.FontSize = zoom
  814.   vsFlexArray.FontName = "Arial"
  815.   If vsFlexArray.Visible Then vsFlexArray.SetFocus
  816. End Sub
  817.